package me.zhengjie.modules.weixin.message.reply;


import me.zhengjie.modules.weixin.message.AbstractMessage;

/**
 * 被动回复消息体抽象父类
 *
 */
public abstract class AbstractReplyMessage extends AbstractMessage {

    public AbstractReplyMessage() {
        setCreateTime(System.currentTimeMillis() / 1000);
    }

    private Object extra;

    public Object getExtra() {
        return extra;
    }

    public void setExtra(Object extra) {
        this.extra = extra;
    }

    public abstract boolean isValidReply();

    /**
     * 子类有特殊需要可覆写该方法
     *
     * @return
     */
    public String toXML() {
        getXStream().alias("xml", this.getClass());
        return getXStream().toXML(this);
    }
}
